package com.lagou.edu.controller;


import com.lagou.edu.Pojo.HotPosition;
import com.lagou.edu.service.GuavaTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.concurrent.ExecutionException;

@RestController
@RequestMapping("/guavaTest")
public class GuavaTestController {


	@Autowired
	private GuavaTestService guavaTestService;

	@RequestMapping("/testInfo")
	public String test() {
		return "guava victory";
	}

	@RequestMapping("/getSourceFromData")
	public List<HotPosition> getSourceFromData() {
		return guavaTestService.getSourceFromdata();
	}

	@RequestMapping("/getSourceFromredis")
	public List<HotPosition> getSourceFromredis() {
		return guavaTestService.getSourceFromredis();
	}

	@RequestMapping("/getSourceFromGuavacache")
	public List<HotPosition> getSourceFromGuavacache() {
		return guavaTestService.getSourceFromGuavacache();
	}


}
